/**
 * 
 */
package org.jaredjennings.tests.idm;

import static org.junit.Assert.assertEquals;

import org.jaredjennings.idm.StringUtils;
import org.junit.Test;

/**
 * @author jjennings
 *
 */
public class MyStringsTests
{

	/**
	 * Test method for {@link org.jaredjennings.idm.MyStrings#getCN(java.lang.String)}.
	 */
	@Test
	public void testGetCN()
	{
		assertEquals("jared", StringUtils.getCN("jared"));
	}

	@Test
	public void testGetCN_FROM_DN() {
		assertEquals("jared", StringUtils.getCN("\\TESTTREE\\dti\\Users\\jared"));
	}
	
	@Test
	public void testGetCN_FROM_DN_FORWARDSLASH() {
		assertEquals("jared", StringUtils.getCN("/TESTTREE/dti/Users/jared"));
	}	
	
	@Test
	public void testGetCN_FROM_DN_COMMA() {
		assertEquals("jared", StringUtils.getCN("cn=jared,ou=users,o=organization"));
	}	
}
